package ddos;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;

public class Ddos {

	public static void main(String[] args) throws Exception {

		try {

			Socket socket = new Socket("www.tmaczhou.cc", 80);

			PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), false);
			out.println("GET /index.html HTTP/1.0");
			out.println();
			out.flush();

			BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream(),"utf8"));

			String inputLine;
			int count = 0;

			while ((inputLine = in.readLine()) != null) {
				count++;
				System.out.println(count);
				System.out.println(inputLine);
			}

			in.close();
			System.out.println("PRINTING HERE!!!");
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
